﻿using socket_server.Transport_Protocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace socket_server
{
    public class CPlayer
    {
        private int DoCM_TestCount { get; set; }
        private int DoCM_FruitCount { get; set; }
        private int DoCM_QueryBagCount { get; set; }
        public void DoCM_Test(CCM_Test cCM_Test)
        {
            if (cCM_Test != null)
            {
                DoCM_TestCount = DoCM_TestCount + 1;
                string Result_Desc = "This is socket_server-DoCM_Test:" + DoCM_TestCount.ToString();
                Console.WriteLine(Result_Desc);
                CSM_Test cSM_DoTest = new CSM_Test()
                {
                    CBaseClassID = CServerToClientClass.SM_Test,
                    CBaseRemoteEndPointStr = cCM_Test.CBaseRemoteEndPointStr,
                    Desc = Result_Desc,
                };
                Program.AddClientMsg(cSM_DoTest);
            }
        }

        public void DoCM_Fruit(CCM_Fruit cCM_Fruit)
        {
            if (cCM_Fruit != null)
            {
                DoCM_FruitCount = DoCM_FruitCount + 1;
                string Result_Desc = "This is socket_server-DoCM_Fruit:" + DoCM_FruitCount.ToString();
                Console.WriteLine(Result_Desc);
                CSM_Test cSM_DoTest = new CSM_Test()
                {
                    CBaseClassID = CServerToClientClass.SM_Test,
                    CBaseRemoteEndPointStr = cCM_Fruit.CBaseRemoteEndPointStr,
                    Desc = Result_Desc,
                };
                Program.AddClientMsg(cSM_DoTest);
            }
        }
        public void DoCM_QueryBag(CCM_QueryBag cCM_QueryBag)
        {
            if (cCM_QueryBag != null)
            {
                DoCM_QueryBagCount = DoCM_QueryBagCount + 1;
                string Result_Desc = "This is socket_server-DoCM_QueryBag:" + DoCM_QueryBagCount.ToString();
                Console.WriteLine(Result_Desc);
                CSM_Test cSM_DoTest = new CSM_Test()
                {
                    CBaseClassID = CServerToClientClass.SM_Test,
                    CBaseRemoteEndPointStr = cCM_QueryBag.CBaseRemoteEndPointStr,
                    Desc = Result_Desc,
                };
                Program.AddClientMsg(cSM_DoTest);
            }
        }

        public void DoCM_Say(CCM_Say cCM_Say)
        {
            if (cCM_Say != null)
            {
                DoCM_QueryBagCount = DoCM_QueryBagCount + 1;
                string Result_Desc = cCM_Say.CBaseRemoteEndPointStr + "说：" + cCM_Say.Say_Content;
                Console.WriteLine(Result_Desc);
                CSM_Test cSM_DoTest = new CSM_Test()
                {
                    CBaseClassID = CServerToClientClass.SM_Test,
                    CBaseRemoteEndPointStr = cCM_Say.CBaseRemoteEndPointStr,
                    Desc = Result_Desc,
                };
                Program.AddPublicClientMsg(cSM_DoTest);
            }
        }
    }
}
